import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

//自定义组件
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // MaterialApp是根组件
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Local Image'),
        ),
        body: HomeContent(),
      ),
      theme: ThemeData(primaryColor: Colors.blue),
    );
  }
}

//body内容组件
class HomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Center(
        child: Container(
      child: Image.asset("images/independentmind.jpeg",
          alignment: Alignment.topCenter,
          // color: Colors.amber,
          colorBlendMode: BlendMode.luminosity,
          fit: BoxFit.cover),
    ));
  }
}
